﻿using static CyberU;
using static CyberU.UI;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;

//HasContent
public class ClickText : SimpleText
{
    public Button _buttonComponent;

    public Button buttonComponent
    {
        get
        {
            if (_buttonComponent == null)
            {
                _buttonComponent = AddOrGetComponent<Button>(gameObject);
            }
            return _buttonComponent;
        }
        set{_buttonComponent = value;}
    }

    public void AddClickListener(UnityAction OnButtonClick)
    {
        // buttonComponent.onClick += OnButtonClick;
        buttonComponent.onClick.AddListener(OnButtonClick);
        // Delog($"bined {OnButtonClick}");
    }
}